﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SmartWMS.Common.ResponseOutput;
using SmartWMS.Server.WarehouseManage.HomeService;
using SmartWMS.Server.WarehouseManage.HomeService.Dto;

namespace SmartWMS.API.Controllers.WarehouseManage
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "Warehouse")]
    public class IHomeManagesController : ControllerBase
    {
        private readonly IHomeServices homeServices;

        public IHomeManagesController(IHomeServices homeServices)
        {
            this.homeServices = homeServices;
        }

        /// <summary>
        /// 首页数据
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<HomeDtoPes> GetHome()
        {
            var list = await homeServices.GetHome();
            return list;
        }


        /// <summary>
        /// 统计销售人和销售金额
        /// </summary>
        /// <param name="overview"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Response<List<OverviewDto>>> ShowCount() { 
            var list = await homeServices.ShowCount();
            return list;  
        }

        /// <summary>
        /// 统计产品销量
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Response<List<ClientDto>>> ShowCountPro() {
            var list = await homeServices.ShowCountPro();
            return list;
        }

        /// <summary>
        /// 统计仓库季度出售多少
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<List<WarehouseDtos>>> ShowCountWarehouse() { 
            var list= homeServices.ShowCountWarehouse();
            return list;
        }
        /// <summary>
        /// 统计产品类别百分比
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<Response<List<productDto>>> ShowproductDto() { 
        var list= await homeServices.ShowproductDto();
            return list;
        }


    }
}
